package com.hill;

public class Student2 {
    public Student2() {
    }

    public Student2(int id, String name, char sex, int age) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    private   int id     ;
    private   String name ;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if(age>150 || age <0){
            this.age=1;
        }else {
        this.age = age;}
    }

    private   char sex;
    private   int age;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
